import request from '@/config/axios'

/** 随访模板信息 */
export interface FollowUpTemplate {
          id: number; // 问卷模板ID
          title?: string; // 问卷标题
          needInputName?: boolean; // 需要填写姓名
          needSelAge?: boolean; // 需要选择年龄
          needSelGender?: boolean; // 需要选择性别
          needSelDate?: boolean; // 需要选择日期
  }

// 随访模板 API
export const FollowUpTemplateApi = {
  // 查询随访模板分页
  getFollowUpTemplatePage: async (params: any) => {
    return await request.get({ url: `/business/follow-up-template/page`, params })
  },

  // 查询随访模板详情
  getFollowUpTemplate: async (id: number) => {
    return await request.get({ url: `/business/follow-up-template/get?id=` + id })
  },

  // 查询随访模板详情
  getFollowUpTemplateAll: async () => {
    return await request.get({ url: `/business/follow-up-template/all` })
  },

  // 新增随访模板
  createFollowUpTemplate: async (data: FollowUpTemplate) => {
    return await request.post({ url: `/business/follow-up-template/create`, data })
  },

  // 修改随访模板
  updateFollowUpTemplate: async (data: FollowUpTemplate) => {
    return await request.put({ url: `/business/follow-up-template/update`, data })
  },

  // 删除随访模板
  deleteFollowUpTemplate: async (id: number) => {
    return await request.delete({ url: `/business/follow-up-template/delete?id=` + id })
  },

  /** 批量删除随访模板 */
  deleteFollowUpTemplateList: async (ids: number[]) => {
    return await request.delete({ url: `/business/follow-up-template/delete-list?ids=${ids.join(',')}` })
  },

  // 导出随访模板 Excel
  exportFollowUpTemplate: async (params) => {
    return await request.download({ url: `/business/follow-up-template/export-excel`, params })
  },
}
